The present disclosure relates to the field of computer technology, and more particularly, to a data accessing method and a data accessing apparatus.
In recent years, with the development of computer technology, various electronic devices like smart phones, multimedia players, personal digital assistants (PDA), laptop computers, tablet computers, personal computers and others are widely used, among which, processing capability of a processing unit has been continuously enhanced while storage capacity and storage speed of a storage device have also been improved.
With people's increasing needs of data accessing, a storage device with a mechanical structure like a traditional hard disk (HDD) is unable to meet requirement. Instead, a digital storage device such as a solid state hard disk (SSD) or the like is proposed. The digital storage device has an extremely high access speed, but its access life (esp. the number of writes is still subject to technical limits at present.
In the traditional HDD, a logical block addressing (LBA) mode is adopted to find content stored thereon. In the LBA mode, a data area on the HDD is uniquely determined by a head, a cylinder (i.e., track), and a sector where it is located. However, the digital storage device has no physical LBA, the chip structure adopted by it is not helical track either. Alternatively, the digital storage device provides access service based on a mapping of a logical address and a physical address, that is, it provides a logical address to an external electronic device to access, and internally achieves a conversion of the logic address and the physical address through the mapping of the logical address and the physical address, thereafter provides actual data access service within the physical address.
As a large number of digital storage devices enter the market, in order to make electronic devices adapt to these digital storage devices, each operating system has made some changes. For example, in Microsoft's operating system Windows 7, disk defragment function designed for the traditional HDD is forbidden. In a defragment process for the traditional HDD, since the logical address of Windows is exactly the same as the physical address of the traditional HDD, chat is, both takes one sector (typically 512 bytes (B)) as a minimum data access unit, so that this function can easily concentrate fragment data (e.g., a file is stored in various parts of a dispersed space on the HDD) in consecutive addresses in order to accelerate the speed to read the file.
However, for the digital storage device, as described above, the logical address of Windows and the physical address of the digital storage device are not the same; the two only have a mapping relationship. Windows takes one sector (typically 512 B) as a minimum data access unit; whereas the digital storage device takes one page (typically 4 kilobytes (KB)) as a minimum data access unit. Therefore, the existing disk defragment function in Windows cannot directly process the physical address in the digital storage device, so this function not only is ineffective for the digital storage device, but may accelerate consumption of its life due to meaningless read and write operations.
Therefore, a new type of data accessing method and data accessing apparatus is desired to solve the above problem.